#ifndef __DEBUG_H
#define __DEBUG_H

#include "stm32f10x.h"

#define USART2_RX_BUF_SIZE 256  
#define FRAME_HEADER '@'    
#define FRAME_TAIL '#'      
#define CMD_IP "IP"         
#define CMD_PORT "PORT"     
#define PARAM_FLASH_ADDR  0x0800F000
typedef struct {
    char product_id[32];
    char device_name[32];
    char token[256];
    char battery_json[128];
} device_config_t;

void USART2_Init(uint32_t baudrate);
void USART2_SendByte(uint8_t data);
void USART2_SendString(char *str);
void USART2_SendData(uint8_t *data, uint16_t len);
void receive_data(void);
extern volatile uint8_t USART2_RX_Buffer[USART2_RX_BUF_SIZE];
extern volatile uint16_t USART2_RX_Index;
uint8_t ascii_to_hex(uint8_t high, uint8_t low);
#endif /* __DEBUG_SIMPLE_H */
